package com.ciaojian.timer.service;

import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import com.ciaojian.core.mapper.OrderMapper;
import com.ciaojian.core.model.Order;
import com.ciaojian.core.service.OrderService;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author Atlakyn
 */
@Service
public class OrderServiceImpl extends OrderService<OrderMapper, Order> {

    /**
     * 查询超时订单
     * <p>取号超过 8 小时</p>
     *
     * @return 超时订单列表
     */
    public List<Order> findOrderTimeOut() {
        return this.getBaseMapper().findOrderTimeOut(DateUtil.offset(new Date(), DateField.HOUR, -36),DateUtil.offset(new Date(), DateField.HOUR, -8));
    }
}
